Local pytest/unit run test_get_extensions_data_dir() fails
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
I've setup the snapcraft-dev lxc environment by following the instruction on the Hacking readme file on the Snapcraft Github repository. When running the static test suite via pytest, the test_get_extensions_data_dir fails with the following error:
def test_get_extensions_data_dir():
> assert (get_extensions_data_dir() / "desktop").is_dir()
E AssertionError: assert False
E + where False = <bound method Path.is_dir of PosixPath('/home/ubuntu/.venv/snapcraft/share/snapcraft/extensions/desktop')>()
E + where <bound method Path.is_dir of PosixPath('/home/ubuntu/.venv/snapcraft/share/snapcraft/extensions/desktop')> = (PosixPath('/home/ubuntu/.venv/snapcraft/share/snapcraft/extensions') / 'desktop').is_dir
E + where PosixPath('/home/ubuntu/.venv/snapcraft/share/snapcraft/extensions') = get_extensions_data_dir()
tests/unit/extensions/test_extensions.py:234: AssertionError
The error is resolved by running pip install . within the snapcraft directory.
After some investigation I saw that the ./tools/environment-setup.sh, calls the ./tool/environment-setup.local.sh script, which calls pip install --editable "${SNAPCRAFT_DIR}" (https://github.com/snapcore/snapcraft/blob/main/tools/environment-setup-local.sh#L41-L42). Removing the --editable flag fixes the issue in this case, but i'm not sure whether then it breaks the functionality that was initially thought for the local script.
Evaluation history
No evaluation history available.